using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db.SupplyChain.Material;
using HengTong.Model;


namespace HengTong.ViewModel.SupplyChain.SysMeasureUnitGroupVms
{
    public partial class SysMeasureUnitGroupTemplateVm : BaseTemplateVM
    {
        [Display(Name = "名称")]
        public ExcelPropety NameExcel = ExcelPropety.CreateProperty<SysMeasureUnitGroup>(x => x.Name);
        [Display(Name = "编码")]
        public ExcelPropety CodeExcel = ExcelPropety.CreateProperty<SysMeasureUnitGroup>(x => x.Code);
        [Display(Name = "层级")]
        public ExcelPropety LevelExcel = ExcelPropety.CreateProperty<SysMeasureUnitGroup>(x => x.Level);
        [Display(Name = "ErpId")]
        public ExcelPropety ErpIdExcel = ExcelPropety.CreateProperty<SysMeasureUnitGroup>(x => x.ErpId);
        [Display(Name = "详情")]
        public ExcelPropety DescriptionExcel = ExcelPropety.CreateProperty<SysMeasureUnitGroup>(x => x.Description);
        [Display(Name = "状态")]
        public ExcelPropety StateExcel = ExcelPropety.CreateProperty<SysMeasureUnitGroup>(x => x.State);
        [Display(Name = "创建时间")]
        public ExcelPropety CreateTimeExcel = ExcelPropety.CreateProperty<SysMeasureUnitGroup>(x => x.CreateTime);
        [Display(Name = "最后更新时间")]
        public ExcelPropety UpdateTimeExcel = ExcelPropety.CreateProperty<SysMeasureUnitGroup>(x => x.UpdateTime);
        [Display(Name = "备注")]
        public ExcelPropety RemarkExcel = ExcelPropety.CreateProperty<SysMeasureUnitGroup>(x => x.Remark);
        public ExcelPropety CreateByExcel = ExcelPropety.CreateProperty<SysMeasureUnitGroup>(x => x.CreateBy);
        public ExcelPropety UpdateByExcel = ExcelPropety.CreateProperty<SysMeasureUnitGroup>(x => x.UpdateBy);
        [Display(Name = "_Admin.Parent")]
        public ExcelPropety ParentExcel = ExcelPropety.CreateProperty<SysMeasureUnitGroup>(x => x.ParentId);

	    protected override void InitVM()
        {
            ParentExcel.DataType = ColumnDataType.ComboBox;
            ParentExcel.ListItems = DC.Set<SysMeasureUnitGroup>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysMeasureUnitGroupImportVm : BaseImportVM<SysMeasureUnitGroupTemplateVm, SysMeasureUnitGroup>
    {

    }

}
